package ex1;


import org.springframework.beans.factory.ObjectFactory;


/**
 * @author GalK
 */
public class FishFactory_2 {


   private ObjectFactory myServiceFactory;

   public void setMyServiceFactory(ObjectFactory myServiceFactory) {
     this.myServiceFactory = myServiceFactory;
   }

   public Fish getSomeFish() {
     // get a 'fresh', brand new MyService instance
     Fish service = (Fish)this.myServiceFactory.getObject();
     // use the service object to effect the business logic...
      return service;
   }
}
